# dfu-util --alt 0 -D top.dfu
# rm -f top.bit top_out.config top.json top.dfu

yosys -p "read_verilog top.v ../soc.v ../cpu.v ../control_unit.v ../data_path.v ../alu.v ../rom.v ../ram.v ../pc.v ../reg_file.v ../gpio.v ../timer.v; synth_ecp5 -json top.json"
nextpnr-ecp5 --json top.json --textcfg top_out.config --25k --package CSFBGA285 --lpf orangecrab_r0.2.1.pcf
ecppack --compress --freq 38.8 --input top_out.config --bit top.bit

cp top.bit top.dfu
dfu-suffix -v 1209 -p 5af0 -a top.dfu
